import mock from 'mockjs'

// 图片请求
mock.mock('/mock/plan', 'get', {
	code: 0,
	msg: 'success',
	data: {
		plansmall: '../../static/plan.jpg', //主页小图
		planbig: '../../static/foodplan.jpg', //主页大图
		classifyicon: [{ //商品分类图片和信息
				producttypeName: '宠物吃的',
				producttypeImg: '../../static/dogfood.jpg',
				producttypePath: '/pages/dogfood/dogfood'
			},
			{
				producttypeName: '宠物喝的',
				producttypeImg: '../../static/catfood.jpg',
				producttypePath: '/pages/catfood/catfood'
			},
			{
				producttypeName: '清洁洗护',
				producttypeImg: '../../static/petwash.png',
				producttypePath: '/pages/petwash/petwash'
			},
			{
				producttypeName: '日常用品',
				producttypeImg: '../../static/petuse.jpg',
				producttypePath: '/pages/petuse/petuse'
			}
		]
	}
})
// 主页轮播图
mock.mock('/mock/swipe', 'get', {
	code: 0,
	msg: 'success',
	data: [{
			swipeImg: 'https://img2.baidu.com/it/u=724855302,2999493212&fm=253'
		},
		{
			swipeImg: 'https://t7.baidu.com/it/u=825057118,3516313570&fm=193&f=GIF'
		},
		{
			swipeImg: 'https://t7.baidu.com/it/u=1063451194,1129125124&fm=193&f=GIF'
		}
	]
})
// 搜索宠物
mock.mock('/mock/all/search', 'get', {
	code: 0,
	msg: 'success',
	data: []
})
// 所有宠物
const petlist = mock.mock({
	code: 0,
	msg: 'success',
	'data|10': [{
		petId: '@id',
		petName: '@cname',
		petAge: '一岁半',
		petSex: 0,
		petType: '猫',
		petBreed: '布偶',
		petVaccine: 1,
		petSterilization: 0,
		petInisect: 1,
		petImg: 'https://img0.baidu.com/it/u=2153766585,2520033563&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500',
		petDescr: '猫咪非常可爱，活泼好动，黑眼睛，白毛',
		petDelete: null
	}]
})
mock.mock('/mock/pet/all', 'get', petlist)
// 发布送养（图片上传，信息上传）
// 图片上传（'/api/petimg/upload'）
// 信息上传
mock.mock('/mock/examinedeliver/sendinfo', 'post', {
	code: '0',
	msg: '信息提交成功'
})
// 领养人信息
mock.mock('/mock/examineneck/adoptinfo', 'post', {
	code: 0,
	msg: 'success'
})
// 根据id返回宠物详情
mock.mock('/mock/id', 'get', {
	code: 0,
	msg: '宠物信息',
	data: {
		petId: '@id',
		petName: '@cname',
		petAge: '一岁半',
		petSex: 0,
		petType: '猫',
		petBreed: '布偶',
		petVaccine: 1,
		petSterilization: 1,
		petInisect: 0,
		petImg: 'https://img0.baidu.com/it/u=2153766585,2520033563&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500',
		petDescr: '猫咪非常可爱，活泼好动，黑眼睛，白毛',
		petDelete: null
	}
})
// 根据宠物id返回送养人详情
mock.mock('/mock/deliver', 'get', {
	code: 0,
	msg: 'success',
	data: {
		deliverAvatar: '../../static/logo.png',
		deliverName: '璐璐',
		deliverPhone: '17765022324',
		deliverAddress: '陕西省西安市碑林区'
	}
})
// 所有商品信息
const goodlist = mock.mock({
	code: 0,
	msg: 'success',
	'data|10': [{
		productId: '@id',
		productImg: '../../static/food2.jpg',
		productName: '@cname',
		productPrice: '440',
		productDetails: '让它反映股市健康是下得厨房VG还不能健康码',
		productSwipe: [
			'https://img2.baidu.com/it/u=724855302,2999493212&fm=253',
			'https://t7.baidu.com/it/u=825057118,3516313570&fm=193&f=GIF',
			'https://t7.baidu.com/it/u=1063451194,1129125124&fm=193&f=GIF'
		],
		productDescr: [
			'../../static/food1.jpg',
			'../../static/dog1.jpg',
			'../../static/dog2.jpg',
			'../../static/dog3.jpg'
		],
		productCategory: '宠物吃的'
	}]
})
mock.mock('/mock/shopping/all', 'get', goodlist)
// 商品详情
mock.mock('/mock/shopping/id', 'get', {
	code: 0,
	msg: 'success',
	data: {
		productId: '@id',
		productImg: '../../static/food2.jpg',
		productName: '@cname',
		productPrice: '440',
		productDetails: '让它反映股市健康是下得厨房VG还不能健康码',
		productSwipe: [{
				productswipeImg: 'https://img2.baidu.com/it/u=724855302,2999493212&fm=253'
			},
			{
				productswipeImg: 'https://t7.baidu.com/it/u=825057118,3516313570&fm=193&f=GIF'
			},
			{
				productswipeImg: 'https://t7.baidu.com/it/u=1063451194,1129125124&fm=193&f=GIF'
			}
		],
		productDescr: [{
				productdescrImg: '../../static/food1.jpg'
			},
			{
				productdescrImg: '../../static/food1.jpg'
			},
			{
				productdescrImg: '../../static/dog2.jpg'
			},
			{
				productdescrImg: '../../static/dog3.jpg'
			}
		],
		productType: '狗粮'

	}
})
// 商品添加购物车
mock.mock('/mock/shopping/addcart', 'get', {
	code: 0,
	msg: '加购成功'
})
// 商品搜索，返回符合条件的所有商品
mock.mock('/mock/shopping/search', 'get', {
	code: 0,
	msg: 'success',
	data: []
})
// 购物车列表
mock.mock('/mock/cart/list', 'get', {
	code: 0,
	msg: 'success',
	'data|3': [{
		productId: '@id',
		productImg: '../../static/food2.jpg',
		productName: '@cname',
		productPrice: '440',
		productDetails: '让它反映股市健康是下得厨房VG还不能健康码',
		productSwipe: [
			'https://img2.baidu.com/it/u=724855302,2999493212&fm=253',
			'https://t7.baidu.com/it/u=825057118,3516313570&fm=193&f=GIF',
			'https://t7.baidu.com/it/u=1063451194,1129125124&fm=193&f=GIF'
		],
		productDescr: [
			'../../static/food1.jpg',
			'../../static/dog1.jpg',
			'../../static/dog2.jpg',
			'../../static/dog3.jpg'
		],
		productType: '狗粮',
		productNum: '2'
	}]
})
// 购物车商品数量加减
mock.mock('/mock/cart/update', 'get', {
	code: 0,
	msg: '商品数量修改成功',
	data: null
})
// 购物车商品删除

// 点击支付，返回支付成功
mock.mock('/mock/shopping/order', 'post', {
	code: 0,
	msg: '支付成功',
	data: null
})
// 地址列表
mock.mock('/mock/address/list', 'get', {
	code: 0,
	msg: 'success',
	'data|10': [{
		name: '@cname',
		addressDetail: "去玩儿过",
		areaCode: "220523",
		city: "通化市",
		county: "辉南县",
		isDefault: true,
		province: "吉林省",
		tel: "13312345678",
		id: '@id'
	}]
})
// 删除地址
mock.mock('/mock/address/delete', 'get', {
	code: 0,
	msg: '删除成功',
	data: null
})
// 新增地址
mock.mock('/mock/address/add', 'get', {
	code: 0,
	msg: 'success'
})
// 根据地址id拿到地址所有数据
mock.mock('/mock/address/id', 'get', {
	code: 0,
	msg: 'success',
	data: {
		name: '@cname',
		addressDetail: "去玩儿过",
		areaCode: "220523",
		city: "通化市",
		county: "辉南县",
		isDefault: true,
		province: "吉林省",
		tel: "13312345678",
		id: '@id'
	}
})
// 编辑地址
mock.mock('/mock/address/edit', 'post', {
	code: 0,
	msg: 'success'
})
// 修改用户的登录信息
mock.mock('/mock/user/updateinfo', 'post', {
	code: 0,
	msg: '修改成功',
	data: null
})
// 登录
mock.mock('/mock/user/login', 'post', {
	code: 0,
	msg: '登录成功',
	data: {
		userAvatar: '../../static/logo.png',
		userName: '璐璐',
		userInfo: '',
		userSex: '',
		userAddress: '',
		userTag: ''
	}
})
// 获取用户的我的领养数据
mock.mock('/mock/user/mydeliver', 'get', {
	code: 0,
	msg: 'success',
	data: [{
			petId: '@id',
			petName: '@cname',
			petAge: '一岁半',
			petSex: 0,
			petType: '猫',
			petBreed: '布偶',
			petVaccine: 1,
			petSterilization: 1,
			petInisect: 0,
			petImg: 'https://img0.baidu.com/it/u=2153766585,2520033563&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500',
			petDescr: '猫咪非常可爱，活泼好动，黑眼睛，白毛',
			petDelete: null,
			petState: 1 //宠物领养状态，成功
		},
		{
			petId: '@id',
			petName: '@cname',
			petAge: '一岁半',
			petSex: 0,
			petType: '猫',
			petBreed: '布偶',
			petVaccine: 1,
			petSterilization: 1,
			petInisect: 0,
			petImg: 'https://img0.baidu.com/it/u=2153766585,2520033563&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500',
			petDescr: '猫咪非常可爱，活泼好动，黑眼睛，白毛',
			petDelete: null,
			petState: 0 //宠物领养状态，已取消
		},
	]
})
// 获取用户送养信息
mock.mock('/mock/user/mysend', 'get', {
	code: 0,
	msg: 'success',
	data: [{
		petId: '@id',
		petName: '@cname',
		petAge: '一岁半',
		petSex: 0,
		petType: '猫',
		petBreed: '布偶',
		petVaccine: 1,
		petSterilization: 1,
		petInisect: 0,
		petImg: 'https://img0.baidu.com/it/u=2153766585,2520033563&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500',
		petDescr: '猫咪非常可爱，活泼好动，黑眼睛，白毛',
		petDelete: null,
		petsendState: 0 //宠物送养状态，等待
	}]
})
// 获取我的订单页面，订单信息
mock.mock('/mock/user/myorder', 'get', {
	code: 0,
	msg: 'success',
	'data|5': [{
		orderId: '@id',
		orderTime: '@date("yyyy-MM-dd")',
		orderState: '@natural(0, 3)',
		productId: '@id',
		productImg: '../../static/food2.jpg',
		productName: '@cname',
		productPrice: '440',
		productDetails: '0添加剂，营养全面',
		productSwipe: [
			'https://img2.baidu.com/it/u=724855302,2999493212&fm=253',
			'https://t7.baidu.com/it/u=825057118,3516313570&fm=193&f=GIF',
			'https://t7.baidu.com/it/u=1063451194,1129125124&fm=193&f=GIF'
		],
		productDescr: [
			'../../static/food1.jpg',
			'../../static/dog1.jpg',
			'../../static/dog2.jpg',
			'../../static/dog3.jpg'
		],
		productType: '狗粮',
		productNum: '2'
	}]
})